/**
 * @author zhaoren
 * @version 1.0
 * @description 发起人
 * @date 2020/8/10 11:24
 **/
public class Originator {


    /**
     * 需要保存的属性，可能会有多个
     */
    private String state;


    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }


    public void setMemento(Memento memento){
        this.state = memento.getState();
    }

    public Memento createMemento(){
        return new Memento(state);
    }

    public void show(){
        System.out.println("当前状态为:" + state);
    }

}
